﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AssetCategory.aspx.cs" Inherits="UserWork_AssetCategory" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>资产类别</title>
    <link href="../Style/MyWork.css" rel="stylesheet" />
    <style>
        /* 侧边栏样式 */
        .menus {
            list-style: none;
            padding: 0;
            margin: 0;
            transition: left 0.5s; /* 动画效果 */
            position: absolute;
            top: 100px;
            left: -200px; /* 默认隐藏 */
            bottom: 0;
            overflow-y: auto;
            float: left;
            width: 200px;
            height: 650px;
            background-color: coral;
            border-radius: 11px;
        }

            .menus li {
                padding: 3px;
            }

            .menus a {
                text-decoration: none;
                display: block;
                padding: 8px 16px;
                color: black;
            }

                .menus a:hover {
                    background-color: #555;
                    color: white;
                }
        /* 图片按钮样式 */
        .menu-toggle {
            cursor: grab;
            float: left;
        }

        .button3 {
            position: absolute;
            top: 12%;
            left: 26%;
        }

        /*.product-panel {
            padding: 15px;
        }

        .asset-gridview {
            border-collapse: collapse;
            width: 700px;
            margin-top: 10px;
        }*/
        /*表格样式*/
            .asset-gridview th {
                background-color: #4CAF50;
                color: white;
                text-align: left;
                padding: 10px;
                height:40px;
            }

            .asset-gridview td {
                border: 1px solid #ddd;
                padding: 10px;
                text-align: left;
            }

            .asset-gridview tr:nth-child(even) {
                background-color: #f2f2f2;
            }

            .asset-gridview tr:hover {
                background-color: #ddd;
            }

        /* 上一页、下一页图片样式 */
        .asset-gridview a img {
            vertical-align: middle;
        }

        .list {
            text-decoration: none;
        }


        /* 为 DetailsView 控件添加样式 */
        .DetailsViewStyle {
            font-family: Arial, sans-serif;
            border-collapse: collapse;
            width: 100%;
        }

            /* 为 DetailsView 的头部添加样式 */
            .DetailsViewStyle th {
                background-color: #4CAF50;
                color: white;
                padding: 8px;
            }

            /* 为 DetailsView 的行添加样式 */
            .DetailsViewStyle tr:nth-child(even) {
                background-color: #f2f2f2;
            }

            .DetailsViewStyle tr:hover {
                background-color: #ddd;
            }

            /* 为 DetailsView 的单元格添加样式 */
            .DetailsViewStyle td {
                padding: 8px;
                text-align: left;
                border-bottom: 1px solid #ddd;
            }

            /* 为 DetailsView 的按钮添加样式 */
            .DetailsViewStyle .btn {
                background-color: #4CAF50;
                color: white;
                padding: 6px 12px;
                margin: 4px 0;
                border: none;
                border-radius: 4px;
                cursor: pointer;
                text-decoration:none;
            }

                .DetailsViewStyle .btn:hover {
                    background-color: #45a049;
                }

                /*返回按钮样式*/
        .returnbutton {
            position: absolute;
            top: 13%;
            left: 20%;
        }
            /*返回按钮*/
        .returnbutton {
            background: #fbca1f;
            font-family: inherit;
            padding: 0.6em 1.3em;
            font-weight: 900;
            font-size: 18px;
            border: 3px solid black;
            border-radius: 0.4em;
            box-shadow: 0.1em 0.1em;
            cursor: pointer;
        }

            .returnbutton:hover {
                transform: translate(-0.05em, -0.05em);
                box-shadow: 0.15em 0.15em;
            }

            .returnbutton:active {
                transform: translate(0.05em, 0.05em);
                box-shadow: 0.05em 0.05em;
            }
    </style>
</head>
<body>
    <form runat="server">
        <div id="one">
            <%--第一部分--%>
            <div id="logo">
                <img src="../Image/学校.png" alt="Alternate Text" class="menu-toggle" style="margin: 10px; width: 50px; height: 50px; float: left;" />
                <h3 style="margin-top: 22px; font-size: 20px; float: left;">高校资产管理系统</h3>
            </div>
            <div id="daohang" runat="server">
                <%--导航面板--%>

                <ul style="float: right; list-style-type: none; width: 400px;" runat="server">
                    <li></li>
                    <li style="margin-top: 6px;"><a href="../ChangePwd.aspx" class="Topstatus">修改密码</a></li>
                    <li style="margin-top: 6px;"><a href="../GetPwd.aspx" class="Topstatus">找回密码</a></li>
                    <li style="margin-top: 6px;"><a href="../MyUAMSWeb.aspx" class="Topstatus">退出登录</a></li>

                </ul>
            </div>
        </div>



        <hr align="left" size="3px" color="gray" width="920px" style="width: 100%;" />
        <%--状态栏--%>
        <div id="status">
            资产管理
        <asp:Label ID="lblProErr" runat="server"></asp:Label>
            <asp:Label ID="username" runat="server"></asp:Label>
        </div>


        <nav class="menus">
            <%--侧边栏--%>
            <ul>
                <li style="float: left; list-style: none; padding: 3px;">
                    <a href="MyWork.aspx" style="text-decoration: none;">我的业务</a>
                </li>
                <li style="float: left; list-style: none; padding: 3px;">
                    <a href="InsertAsset.aspx" style="text-decoration: none;">计入资产</a>
                </li>

                <li style="float: left; list-style: none; padding: 3px;">
                    <a href="../MaintenanceMgm/AllMaintenance.aspx">维修申请</a>
                </li>
                <li style="float: left; list-style: none; padding: 3px;">
                    <a href="../UserWork/UpdataAmount.aspx">库存管理</a>
                </li>
                <li style="float: left; list-style: none; padding: 3px;">
                    <a href="../UserWork/AssetBR.aspx" >资产借还管理</a>
                </li>
            </ul>
        </nav>

        <div class="content" style="border-radius: 10px; position: absolute; top: 15%; left: 20%;">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Tid" DataSourceID="LinqDataSource1" CssClass="asset-gridview" Width="600px" Height="600px" BackColor="White" AllowPaging="True" PageSize="7">
                <Columns>
                    <asp:BoundField DataField="Tid" HeaderText="类别编码" InsertVisible="False" ReadOnly="True" SortExpression="Tid" HeaderStyle-Width="70px"/>
                    <asp:BoundField DataField="Tname" HeaderText="类别名称" SortExpression="Tname" />
                    <asp:BoundField DataField="TDescribe" HeaderText="类别描述" SortExpression="TDescribe" />
                </Columns>
                <PagerSettings FirstPageImageUrl="~/Image/首页.png" LastPageImageUrl="~/Image/跳转尾页.png" Mode="NextPreviousFirstLast" NextPageImageUrl="~/Image/31下一页、后一页.png" PreviousPageImageUrl="~/Image/33上一页、前一页.png" />
            </asp:GridView>
            <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="MyUAMS.DAL.DataClasses1DataContext" EntityTypeName="" TableName="AssetType_Table">
            </asp:LinqDataSource>
        </div>

        <div class="content" style="border-radius: 10px; position: absolute; top: 15%; left: 64%;">
            <%--主要内容--%>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeleteCategory" InsertMethod="InsertCategory" SelectMethod="GetAllCategory" TypeName="MyUAMS.BLL.CategoryServer" UpdateMethod="UpdateCategory">
                <DeleteParameters>
                    <asp:Parameter Name="tid" Type="Int32" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="tid" Type="Int32" />
                    <asp:Parameter Name="tname" Type="String" />
                    <asp:Parameter Name="tdescribe" Type="String" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="tid" Type="Int32" />
                    <asp:Parameter Name="tname" Type="String" />
                    <asp:Parameter Name="tdescribe" Type="String" />
                </UpdateParameters>
            </asp:ObjectDataSource>
            <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="600px" AllowPaging="True" AutoGenerateRows="False" DataSourceID="ObjectDataSource1" DataKeyNames="Tid" OnItemDeleting="DetailsView1_ItemDeleting" CssClass="DetailsViewStyle" OnItemInserted="DetailsView1_ItemInserted" BackColor="White" OnItemDeleted="DetailsView1_ItemDeleted" OnItemUpdated="DetailsView1_ItemUpdated">
                <Fields>
                    <asp:BoundField DataField="Tid" HeaderText="类别编码" SortExpression="Tid" Visible="False" />
                    <asp:BoundField DataField="Tname" HeaderText="类别名称" SortExpression="Tname" />
                    <asp:BoundField DataField="TDescribe" HeaderText="描述" SortExpression="TDescribe" />
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" ControlStyle-CssClass="btn"/>
                </Fields>
            </asp:DetailsView>
        </div>
        <asp:Button ID="return" runat="server" OnClick="return_Click" CssClass="returnbutton" Text="返回"/>
    </form>
    <script src="Scripts/MyWork.js"></script>
    <script>
        // 获取侧边栏和图片按钮元素
        var sidebar = document.querySelector('.menus');
        var menuToggle = document.querySelector('.menu-toggle');

        // 为图片按钮添加点击事件
        menuToggle.addEventListener('click', function () {
            // 切换侧边栏的显示和隐藏
            var sidebarStyle = sidebar.style;
            if (sidebarStyle.left === '-200px') {
                sidebarStyle.left = '0';
            } else {
                sidebarStyle.left = '-200px';
            }
        });
    </script>
</body>
</html>
